<?php
	include "Snoopy.class.php";
	$snoopy = new Snoopy;
//$url = 	"http://forecast.weather.gov/MapClick.php?textField1=29.7678&textField2=-93.89231";
	$lat = $_GET['lat'];
	$lon = $_GET['lon'];
	$url = "http://forecast.weather.gov/MapClick.php?textField1=$lat&textField2=$lon&TextType=2";
	
	$snoopy->fetch($url);
	$output = $snoopy->results;
	$output = str_replace('<td width="20%" valign="top" align="right">','',$output); 
	$output = str_replace('<a href=javascript:window.print()><img src="/images/wtf/12.gif" border=0 height=35 width=30 alt=Print title=Print></a>','',$output);
	$output = str_replace('<td colspan="2" valign="top" align="center"><hr><br>','',$output); 

	$outArray = explode('<table',$output);
	$output = '<table'.$outArray[1].'<table'.$outArray[2].'<table'.$outArray[3];
	$output = str_replace("/images/","http://forecast.weather.gov/images/",$output);
	$output = str_replace("www.parkandpaddle.com/","http://forecast.weather.gov/",$output);
	$output = str_replace("showsigwx.php","http://forecast.weather.gov/showsigwx.php",$output);
	echo $output;
//	$snoopy->fetchlinks($url);
//	print_r( $snoopy->results );
	
//	$snoopy->fetchtext($url);
//	echo $snoopy->results;
	
//	$snoopy->fetchlinks($url);
//	print_r( $snoopy->results );
?>

